package cpsc433;

import RJ.Environment;

public class SisyphusI {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//String inputFileName = "test1.in";//arg[3]
		
		if (args.length != 2){
			System.out.println("command error. Please input: \n" +
					" java -classpath G9prog.jar cpsc433.SisyphusI filename maxtime");
		}else {
		
			String inputFileName = args[0];
			String outputFileName = inputFileName + ".out";
			
			Environment env = new Environment("ENV");
			int flagInt;
			flagInt = env.fromFile(inputFileName);
			if (flagInt == -1) {
				System.out.println("Cann't open file");
			}else {
				int timeLimit;
				timeLimit = Integer.parseInt(args[1]);		
				
				env.assignPersonToRoom(timeLimit, outputFileName);
			}
		}
	}

}
